package team.dmh.wx.enums;

import lombok.Getter;

/**
 * @Auther: Hz1kai
 * @Date: 2018/10/19 23:00
 * @Description:
 */
@Getter
public enum MsgOpsTypeEnum {

    CONNECT(1, "第一次(或重连)初始化连接"),
    CHAT(2, "聊天消息"),
    SIGNED(3, "消息签收"),
    KEEP_ALIVE(4, "客户端保持心跳"),
    PULL_FRIEND(5, "拉取好友"),
    PULL_FRIEND_REQUEST(6,"拉取好友请求列表"),
    FRIEND_ERROR(7,"对方已经不是你的好友");

    public final Integer type;
    public final String msg;

    MsgOpsTypeEnum(Integer type, String content) {
        this.type = type;
        this.msg = content;
    }

    public static MsgOpsTypeEnum getByType(Integer type){
        for (MsgOpsTypeEnum msgOpsTypeEnum:MsgOpsTypeEnum.values()){
            if (msgOpsTypeEnum.type==type){
                return msgOpsTypeEnum;
            }
        }
        return null;
    }
}
